package com.logicwin.aibala.model.androidSWInfo;

import java.sql.Timestamp;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import com.logicwin.aibala.action.LoadStartUpAction;
import com.logicwin.aibala.com.AibalaException;
import com.logicwin.aibala.services.file.ImageManager;

import android.R;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * Android软件列表项
 * 
 * @author GuoDing
 * @since 2011-05-27
 */
public class APKListItem {
	
	/**
	 * apk地址
	 */
	private String apkAddress;
	
	public String getAPKAddress() {
		return this.apkAddress;
	}
	
	public void setAPKAddress(String address){
		apkAddress = address;
	}
	
	/**
	 * 软件标识ID
	 */
	private int swID;
	
	public int getID() {
		return this.swID;
	}
	
	public void setID(int id){
		swID = id;
	}
	
	/** 
	 * 软件名称 
	 */
	private String apkName;
	
	public String getAPKName() {
		return this.apkName;
	}
	public void setAPKName(String name) {
		apkName = name;
	}
	
	/**
	 * 软件版本字符
	 */
	private String versionName;
	
	public String getVersion() {
		return this.versionName;
	}
	public void setVersion(String version) {
		this.versionName = version;
	}
	
	/** 
	 * 图标 
	 */
	private String iconPicUrl;
	private Bitmap iconPic = null;
//	private int iconResid = 0;
	
	public void setIconURL(String url) {
//		iconPic = ImageManager.getImage(url);
		this.iconPicUrl = url;
	}
	
	public String getIconURL() {
		return this.iconPicUrl;
	}
	
//	public int getIconResID() {
//		return this.iconResid;
//	}
	
	/** 
	 * 推荐星数量 
	 */
	private int refStarCount;
	
	public int getRefStarCount() {
		return this.refStarCount;
	}
	public void setRefStarCount(int count) {
		this.refStarCount = count;
	}
	
	/** 
	 * 下载次数 
	 */
	private String downloadCount;
	
	public String getDownloadCount() {
		return this.downloadCount;
	}
	public void setDownloadCount(String downCount) {
		this.downloadCount = downCount;
	}
	
	/** 
	 * 文件大小
	 */
	private String apkSize;
	
	public String getAPKSize() {
		return this.apkSize;
	}
	public void setAPKSize(String size) {
		this.apkSize = size;
	}
	
	/**
	 * 类别ID
	 */
	private int classID;
	
	public int getClassID() {
		return this.classID;
	}
	
	/**
	 * 当前安装状态
	 */
	private int currState = APKFileMgmt.APK_STATE_NO_LOAD;
	
	public int getCurrState() {
		return this.currState;
	}
	
	public void setState(int stat) {
		this.currState = stat;
	}
	
	public void reload() {
	}
	
	/**
	 * 点击下载
	 * @throws AibalaException
	 */
	public void startDownload() throws AibalaException {
	}
	
	/**
	 * 点击更新
	 * @throws AibalaException
	 */
	public void startUpdate() throws AibalaException {
	}
	
	/**
	 * 停止下载
	 */
	public void stopDownload() {
	}
	
	/**
	 * 获取当前下载的百分比
	 * @return
	 */
	public int getCurrDownload() {
		return 0;
	}
	
	public APKListItem() {
		this.apkName = null;
		this.apkSize = null;
		this.classID = 0;
		this.currState = 0;
		this.downloadCount = null;
		this.iconPic = null;
		this.iconPicUrl = null;
		this.refStarCount = 0;
		this.swID = 0;
		this.versionName = null;
	}
	
	public APKListItem(int id) {
		this.swID = id;
	}

	private int detailResID;
	
	public Bitmap getDetailPic() {
		return null;
	}
	
	public int getDetailResID() {
		return this.detailResID;
	}

}








